草庐IT

ios - 快速http请求无法获得非200响应

全部标签

ruby-on-rails - 安装debugger-linecache(1.1.1)时出错,Bundler无法继续

知道如何解决这个问题吗?Gem::Installer::ExtensionBuildError:ERROR:Failedtobuildgemnativeextension./home/durrantm/.rvm/rubies/ruby-1.9.3-p194/bin/rubyextconf.rbcheckingforvm_core.h...nocheckingforvm_core.h...noMakefilecreationfailed**************************************************************************Nos

ruby - 无法对 ruby​​ 哈希使用点语法

我正在使用net/http从YahooPlacemakerAPI中提取一些json数据。收到响应后,我正在对响应执行JSON.parse。这给了我一个看起来像的散列:{"processingTime"=>"0.001493","version"=>"1.4.0.526build111113","documentLength"=>"25","document"=>{"administrativeScope"=>{"woeId"=>"2503863","type"=>"Town","name"=>"Tampa,FL,US","centroid"=>{"latitude"=>"27.9465

ruby-on-rails - 为什么 bundler 无法访问 http ://rubygems. 组织?

关闭。这个问题是off-topic.它目前不接受答案。想改进这个问题吗?Updatethequestion所以它是on-topic用于堆栈溢出。关闭10年前。ImprovethisquestionBundle安装昨天运行良好,但现在它在CL中返回此输出:~/dev/rails/sample_app$bundleinstallFetchinggemmetadatafromhttps://rubygems.org/.ErrorBundler::HTTPErrorduringrequesttodependencyAPIFetchingfullsourceindexfromhttps://ru

ruby-on-rails - Bundle Install 无法从 https ://rubygems. org/获取规范

我正在尝试遵循HartlRails教程,但在使用bundlergem时遇到了问题。当使用命令“bundleinstall”或“bundleupdate”时,我得到以下输出:Fetchingsourceindexfromhttps://rubygems.org/Couldnotfetchspecsfromhttps://rubygems.org/我搜索过这个输出,但没有在网上找到很多相关问题。也许我有另一个干扰bundler的gem?在这一点上,我对Rails没有什么经验。source'https://rubygems.org'gem'rails','3.2.12'group:devel

ruby - 如何使用 open-uri 发出 POST 请求?

是否可以使用open-uri从Ruby发出POST请求? 最佳答案 不幸的是open-uri只支持GET动词。你可以下拉一个级别使用net/http,或者使用rest-open-uri,它被设计用来支持POST和其他动词。您可以执行geminstallrest-open-uri来安装它。 关于ruby-如何使用open-uri发出POST请求?,我们在StackOverflow上找到一个类似的问题: https://stackoverflow.com/ques

ruby - 无法在 ruby​​ 中要求 openssl

我在我的虚拟机ubuntu12.04lts中安装了openssl。当我运行gem命令时出现错误。Error:whileexecutinggem(Gem::Exception)Unabletorequireopenssl.installopenSSLandrebuiltruby(preferred)orusenonHTTPssources而且我还在irb模式下测试了requireopenssl。它给出了错误。Loaderror:cannotloadsuchfile--opensslfrom/usr/local/lib/ruby/site_ruby/2.1.0/rubygems/core_

ruby - 有没有办法为 heroku 上的 Ruby on Rails 应用程序设置简单的 http 身份验证?

我想使用简单的http身份验证在heroku上设置一个私有(private)登台服务器。这可能吗? 最佳答案 一种更简洁的方法是将几行Rack中间件放入您的暂存环境配置中,单独留下Controller逻辑:#config/environments/staging.rbMyApp::Application.configuredoconfig.middleware.insert_after(::Rack::Lock,"::Rack::Auth::Basic","Staging")do|u,p|[u,p]==['username','pa

ruby-on-rails - PostgreSQL gem pg 无法安装

我的数据库是PostgreSQL。我在CENTOS上...。在安装pggem时,我收到以下错误。我也重新安装以清除我的YAML问题,但没有用,但这只是一个警告。我的主要问题是pggem的安装:[root@vdimc04~]#geminstallpg/usr/local/lib/ruby/1.9.1/yaml.rb:56:in`':Itseemsyourrubyinstallationismissingpsych(forYAMLoutput).Toeliminatethiswarning,pleaseinstalllibyamlandreinstallyourruby.Buildingn

ruby-on-rails - 在 Rails 中进行 Http 基本身份验证

大家好,我来自Grails,是Rails的新手。我希望在Rails中进行http基本身份验证。我在grails中有一个代码可以像这样进行基本身份验证:defauthString="${key}:".getBytes().encodeBase64().toString()defconn="http://something.net".toURL().openConnection()conn.setRequestProperty("Authorization","Basic${authString}")可以用Rails做同样的事情吗? 最佳答案

ruby - 安装后无法使用 compass

我似乎无法使用thisVagrantfile使compass在Vagrant上工作.请在此处查看其余的bash脚本(已删除repo)(如果您想配置您的VagrantUbuntuBox,请参阅Vaprobash!)。因此,当我不得不使用gruntserver时,我正在学习gruntjs类(class)。唯一的问题是它需要更新的ruby​​版本(我相信是1.9+而不是1.8)并且它需要compass。所以我通过安装RVM和安装最新的稳定版本解决了ruby​​部分。compass应该很容易获得geminstallcompass并且它似乎确实已安装。但是当我输入compass-v时,我得到了休